package com.blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.blog.dao.UserPoJoMapper;
import com.blog.model.UserPoJo;
import com.blog.service.interfaces.IUserService;

@Service("userService")
public class UserService implements IUserService {
	@Autowired
	UserPoJoMapper userPoJoMapper;
	
	
	
	public UserPoJo getUserByName(String name){
		return userPoJoMapper.selectByName(name);
	}
	
	public UserPoJo getUserById(Integer u){
		return userPoJoMapper.selectByPrimaryKey(u);
	}
	
	public int register(UserPoJo u){
		return userPoJoMapper.insertSelective(u);
	}
}
